Skip to content

Instantly share code, notes, and snippets.

@anthony-wang
anthony-wang / spotify-hosts.txt
Last active May 10, 2024 19:36
The hosts file entries to block Spotify ad servers
# Use this to block Spotify ad servers
# sources:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
# https://gist.github.com/teomaragakis/cb187d880c9a3ca2c8a2
# https://gist.github.com/Shujito/b7a8f8f971b22f49b4313d7d3e8e6931
# https://gist.github.com/rifkyekayama/f7c43e470f23878b20416e68f73829dc
# https://gist.github.com/shokoylele/8f4160a102480471cb946fbd800bc86a
############## Begin manual list
# 127.0.0.1 spclient.wg.spotify.com # might block the entire Spotify app from working too
/*
Adapted from https://github.com/sindresorhus/github-markdown-css
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@staaldraad
staaldraad / huaweiDecrypt.py
Created March 11, 2015 13:19
Decrypt Huawei router/firewall passwords. Huawei stores passwords using DES encryption when the crypted option is enabled.
#!/usr/bin/python
"""
Simple tool to extract local users and passwords from most Huawei routers/firewalls config files.
Will extract plain-text passwords and crypted credentials. Huawei config files use DES encryption with
a known key. Using this information, the script will decrypt credentials found in the config file.
Author: Etienne Stalmans (etienne@sensepost.com)
Version: 1.0 (12/01/2014)
"""
from Crypto.Cipher import DES
#NoEnv
SetBatchLines, -1
#MaxHotkeysPerInterval 200
#Include <VA>
; Create the slider window
Gui, Add, Progress, w100 h20 x0 y0 Range0-100 vVolSlider, 0
Gui, Add, Text, w100 h20 x0 y0 vVolText BackgroundTrans Center +0x200, 0
Gui, +AlwaysOnTop -Caption +ToolWindow
Gui, Show, Hide w100 h20 x0 y0, Volume
@mh-keshavarz
mh-keshavarz / silk-profiler.py
Last active May 10, 2024 19:31
A function replacing silk middleware
from django.test.client import RequestFactory
from django.http import HttpResponse
from django.db import transaction, DatabaseError
from django.db.models.sql.compiler import SQLCompiler
from django.utils import timezone
from silk.collector import DataCollector
from silk.config import SilkyConfig
from silk.model_factory import RequestModelFactory, ResponseModelFactory
from silk.profiling.profiler import silk_meta_profiler
@nikhita
nikhita / update-golang.md
Last active May 10, 2024 19:31
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@bartkl
bartkl / backend.py
Last active May 10, 2024 19:29
Streaming JSON chunks (FastAPI <-> fetchAPI)
# FastAPI.
async def stream_json_list(items):
for item in items:
yield item
await asyncio.sleep(4.0) # To demonstrate, visibly, the successful implementation.
async def get_media_metadata(tags: Optional[Set[str]] = Query(None,
description="Tags to filter on")):
@Arax20
Arax20 / ptRun.ahk
Last active May 10, 2024 19:25
Allows rebinding of winkey to a shortcut without getting in the way of system winkey shortcuts.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
LWin::
Input, x, L1 ; Catches key after winkey
if (ErrorLevel = "NewInput") ; If catching was interrupted
{
Send #+r ; Set this to your powertoys run shortcut
@kksudo
kksudo / vpn-instructions.md
Last active May 10, 2024 19:19
Настраиваем подключение к впн Устанавливайте только Stable версии приложений!

Настраиваем подключение к впн Устанавливайте только Stable версии приложений!

Подробнее про клиенты и настройку можно почитать по этой ссылке

Android

  1. NekoBox for Android
  • Скачать и установить приложение на смартфон.
  • Скопировать ключ в буфер обмена
@tony-caffe
tony-caffe / nagios-slack-alert.sh
Last active May 10, 2024 19:18
Nagios to post alerts into a Slack channel # using the Incoming WebHooks integration
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here: